﻿using System;
using System.Collections.Generic;
namespace RushTracker.Core.Data
{
    public interface IDataRepository
    {
        void DeleteObject(object o);
        T GetObjectById<T>(int id);
        IList<T> GetAll<T>();
        RushTracker.Core.Models.User GetUserByUsername(string username);
        RushTracker.Core.Models.User GetUserByUsernameAndPassword(string username, string password);
        RushTracker.Core.Models.Torrents.Torrent GetTorrentByInfoHash(string infoHash);
        IList<RushTracker.Core.Models.Torrents.Torrent> GetLatestTorrents(int rows, int? categoryId);
        IList<RushTracker.Core.Models.Torrents.Category> GetTopLevelCategories();
        void SaveObject(object o);
        void UpdateObject(object o);
        void Flush();

        Models.User GetUserByKey(string key);

        Models.Torrents.Peer GetPeerByInfoHashAndPeerId(string infoHash, string peerId);
    }
}
